package edu.gdin.ecommerce.util;

import java.util.HashMap;
import java.util.Map;

import com.opensymphony.xwork2.ActionContext;

public class ParamConverter {

	@SuppressWarnings("unchecked")
	public static String paramsConvert(String paramDetaiId, String defaultValue) {
		Map<String, Object> application = ActionContext.getContext().getApplication();
		Map<String, Object> params = (Map<String, Object>) application.get("params");
		
		if(params != null && params.size() !=0) {
			return params.get(paramDetaiId).toString();
		} else {
			return defaultValue;
		}
	}
	
}
